package com.chinasofti.enmu1;

class Season{
    //1.类的属性 private final
    private final String seasonName;
    private final String seasonDesc;
    //在构造器中初始化属性
    private Season(String seasonName,String seasonDesc){
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }
    //提供获取属性的方法
    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }
    //创建四个季节
    public static final Season SPRING = new Season("spring","春暖花开");
    public static final Season SUMMER = new Season("summer","夏日炎炎");
    public static final Season AUTUMN = new Season("autumn","秋高气爽");
    public static final Season WINTER = new Season("winter","白雪皑皑");

    @Override
    public String toString() {
        return "Season{" +
                "seasonName='" + seasonName + '\'' +
                ", seasonDesc='" + seasonDesc + '\'' +
                '}';
    }
    public void show(){
        System.out.println("这是一个季节！");
    }
}

public class TestSeason {
    public static void main(String[] args) {
        Season spring = Season.AUTUMN;
        System.out.println("spring = " + spring);
        spring.show();
        System.out.println(spring.getSeasonName());
    }
}